package com.example.makerspace.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
public abstract class BaseDO {

    @Id
    @Field(type = FieldType.Integer)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
    protected Date createTime;

    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
    protected Date modifyTime;
}
